Added readonly attribute for fields whose state is readonly