updated reading from database