Added code to create spool dir if it does not exist.