fixes #540