partial solution for #547