quick fix to prevent infinite trees. kinda lame, though