Fixed logic in the app side for selecting criteria