Fixed the height just for visible elements

I thing this is not the best solution, but in my tests it's okay