-- fixed some bugs