fixed bug when user use escape on keyboard