fixed #27
fixed #29, fixed #30