No person shall be punished for omitting to perform an act, where such act has been performed by another person acting in his behalf, and competent by law to perform it.