Issue37

fix #37, based on #29