fixed #1567 #1540