Fixed a bug with hiding panels