fixed #1110 and #1109