more robust solution for #689