took me a while to figure out why my query wasn't working :) Over-ambitious replacement of $ here.