error checking for when token is empty