not perfect but better. for issue #3710