check for write permissions