Fixed bugs in when token is not found