added options to write_command