added try/catch in replaceBook