Change error event to occur only in 404. close #921