fixed problem with virtual methods