Remove a stray console.log
missing semicolons...
Adding in some error checking