fixed #35, fixed #34, fixed #33, fixed#36