Linking autocomplete toggle with database build