fix bug in tables