removed debug output and fixed event misfiring