some bugs were fixed