fix problem to write moves