reads data from db