** some bugs repaired