more fixing sql after id changes due to end testing