fix front end sorting of documents

fixes #44 for 1.0 branch