prevent infinite-loops when loading mercury editor