fixes a bug which caused endless recursion