changed check for authenticated user to be more semantic