fixed #509