fix bug #2787