fixed some bugs..