fixed bug in persistent ref in collection in context.state