fixed alot of minor issues as token-check but also estiticity in the code