added cat's NULL handling, to lazy to merge