lift reader, writer, state to error automatically