Added code to setNoWait and setBlocked now the argument is corrected