I found the reason why it’s happening. The code used to help stick footer of the page to the bottom make it. After removing it everything is fine. It looks like I will need to use alternative solution. I attach the problematic the code below.
@David can you please propose something else than the one below?