Fix create record

Check if category is null