added error event for timers
move some utility functions out of the way