check that options.where exists before checking for key in it