fixed bug 1791