check write permissions