Changed the JS alert to a var