realy fixed reset local stuff functions