Check and create directory if it does not exist