refactored error events