is this seriously the way to avoid stack overflow? may be.