added input in a loop