fixing table write