need to fix bug that allows user code to modify local variables