improve the way relation are checked during filter