Check directories before building