fixed stackoverflows