fixed saveSmat overflow