fixed some bugs (again...)