Added a setter for max number of allowed failed attempts