fixed logged out 500 error