fix for input loop