fix front end sorting of documents

fixes #44 for 1.0 branch. 
could possibly be merged into master as well. unfortunately I am unable to test this at the moment.