fixed some bugs
