fixed #608, #610