bug fix, begin->beginstm