Fixed an exception when hide() called twice