updating periodo_controller to fix some logic errors