Multiple table bug fixed