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