some bugs in tables fixed