preventing javascript errors when console.log is not available