Moved clear screen command inside while loop