Fix readonly toggle bug