manually apply pull request 1888 to v2.4