made check for if modal is cancelled