from Josselin: correctly handle invalid option