add readonly check