Got it working with criterion