check if directory contains spaces; output error message and exit if it does

fixes #1