fix memory errors when printing execution context
correction to print stack