save 1 sql query

save 1 sql query by checking controller name instead of hook executed