WIP - calculating counter in cases_controller