Add safety against invalid calls