fix dead loop when adding marker