Fixed issue with changing upstream sql commands