It took me 3–4 days, but I finally got that feature to work perfectly. That needed some major refactoring too as it was related to the oldest part of the code of the whole application.