fixes partially #2939