moved exec to after error check
Merge pull request #9 from GamingRobot/patch-1

moved exec to after error check