Fixed a query merging issue
Merge branch 'mdm-scratch' of github.com:WSO2Mobile/mdm into mdm-scratch