Panel close bugfix