fixed an error that happened when the session cookie wasn't set