add check for readonly attribute