Added check to postbuild for target directory