only create p if the dir exists