Add back invalid category check on write