fixed endless recursion