fixed bug when clicking outside of modal