fixed #8, fixed #6