fixed #6, fixed #28