fixed bug 1787