fix bug 1074195 and 1072897