more robust handling of marks