#540 added changes for #535