swap conditions for readonly check