Added 'undefined' checks

Checking 'screen' and 'canvas.style' for 'undefined'