fix stackoverflow