change sql query in index controller