fixes partially #2939

fixes partially #2939