fix spool problems

fixed #191 and #190