fixed strange bug where a comma was always appended to m_query