fixes #2122

fixed the issue and pushed the code on master-2.2.1