Added a flag to select device