fix hide/show problem after pressing escape