added -p flag to mkdir to make parents if don't exist