fixed #1066, #1067