fix data type and return loop for chaining