Safety function

These are functions which ensure the user's safety.