fix bug of RedirIO and add globals to exec to make it support import xxx