some bugs fixed
belongs to #62