fix hide and show bugs