FIXED some bugs