catch a class cast exception here and return false.