fixed build directory check for output file. fixes #83