handlers: fix infinite recursion