ensure correct directory permissions