Fix bar hiding logic