fixed issue with calculating height of hidden elements