Properly check if elements are hidden