fix trailing spaces. use isHidden method more.