tidy up, fix the bug of not displaying map in query