fixed code for tokens