added search criteria to javascript