Cannot read pets of undefined error (Fixed)

Fixes issue mentioned in #302