afterError fix