improve solution for #755