fixed some bugs...