some bugs fixed
debugging starts