Make sure user is defined before trying to use it