Fixed search error and updated search to include department