write_empty changed to unsigned int