fixing injections; now creating directory if directory doesn't exist