added while clause