added sql to runafter controller