Fix but in while
Add sample