alternative solution that fixes #334