fixed again while loops