Some spacing changes and checking for valid token/id