fixed #427, thanks peter1000