Fix recurssive method terminate