debugged write on success