try erasing before writing not asyncronously