fixed some errors
fixed some bugs