resolved some bugs