fixed bug when closing panel on build