Fixing 'No documents found' bug