added check to make sure directory doesn't already exist