fixing users viewing dashboard even if not logged in