ADDED check for where key