Added error proof map functionality