improvement for #1791