added explicit type cast to animal