fixing #3127

please see commit message 80207cc6993b1cd1dc94d67c88278054167cfb04 for additional details