add check for readonly attribute
add test for readonly attribute