Problems: Doesn't read the first command, history saves the last input after the loop finished loop ended