fix getExistingLocalDocument and getLocalDocument