Added a custom condition that gets passed a function that takes a single parameter