fixed bug in modal when clicking modal would close it