Fixed bug for authenticating to view profile page