Fixed state recovery in osrf writer

Change-Id: I884ceec4be5803a3e29df745fc88e21ff4a040e8