Reset modal when closed by clicking outside of it