fixed recursive definition infinite loop