added some error checking for invalid filters and invalid operators