Added 'if undefined' for 'clip' variable.