ugly workaround to avoid stack overflow