Added check for login before accessing user home