fix io for recursiveness