chmod for writable directories added