-fixed some bugs