Proper condition around console.log statement to avoid issues in IE