Added token generation
Fixed the register thing