change syntax in loop