fixing tree overflow