etl query fixing