added the validation to leave_application