Fixing REGISTRY-2235

Fixing https://wso2.org/jira/browse/REGISTRY-2235