generate_token raise error if no session id is given
fixed generate token error message