Added in a check to redirect non-authenticated users to the login page