fixed bugs. time-consuming problem still not be fixed