Applying fix for REGISTRY-2175 by shelan@wso2.com