fix bug #168 #169