option --mode and errors handled