Merging fix of https://wso2.org/browse/APPFAC-2627