backporting bugfix