bugfix for #581