use global $marker_query and bugfixes