fix issue 1787