input loop added