try to make auto-reloading changed documents a bit more reliable