check for infinite recursion

closes #10