fixed NPE when a pet is released