fix do-while statement to respect coding style