js updated to work with revised search