moved cleanup so that it doesnt override value setting