resolve some bugs