added a way to reset the error code if sender == 0