extracting data from database seems to work