end error method fixed