try using locals instead of exec