improved some bugs