fix loop writing to proc_memory