fixing search problems,saving sort column for next selection to db