minor bug fix: put bool false inside main while loop