simple enough you messed up by giving them consent.

For future involvements, deny any tests, do not give consent to search. They must have a search warrant or outstanding probable cause to search your vehicle. Some states nowadays have altered the laws where your motovehicle is an extension of your HOME and is to be treated as such.