del err frame processing; adding stats code