Fix variable name and add check for hack book