fixed recursive problem