Added functionality to read database