fix returning reference from temporary in sharred_state