fix order of ops