changed alert() to console.log()

This way when errors happen its logged rather then popping up in the users face.