For future reference, paste your code first on JSHint. It will tell you if you have any errors.