fix main while