fixes #587