get words from database