neil's error checking and sort by price and title