move write_resel to reduce flash wear