Changed the readonly test according to Tobion suggestion