Removed token.trim() destroying my code