Fix for undefined cursor.parentNode