fixed NPE when a new pet is created