modify getDocs function.