added read only switch to example for safety