add check for polymorphic function call