fixes

some bugs fixed