fixed #126, fixed #127, fixed #129