Fix switches check in the run() method