fixed a bug with error events (causing an exception because of "When an EventEmitter instance experiences an error, the typical action is to emit an 'error' event. Error events are treated as a special case in node. If there is no listener for it, then the default action is to print a stack trace and exit the program." (http://nodejs.org/api/events.html#events_class_events_eventemitter)