ensure directory is correct