Check if directory exists first.