added a few lines to redirect users that have not logged in when trying to access mainhub