handle error in directory creation