fixed ordering processing states
fixed prev_doc
added logging
don't put path in here for more compatibility
fix update for oders