changing search, not finished
changed search to save in DB