adapt filter in contract.rb