changed one row to multi row query