Fix directory doesn't exist error