fixing MB-699

Fixing https://wso2.org/jira/browse/MB-699