refactored database access
shows tasks for selected list