cleared figures after it saves and counter for figures