Set read_only attribute only when it is passed in