implemented run and made it raise error on failure