let work-dir stay nil by default
better error output