atomic file writing
decode oops