fixed the mixed up updating