fix single mode (didn't quote when using dirname)