Fix deep recursion

this pr will fix #21