fixes #463 and tests it this time