Added generate token method