Adding error handling if device not connected or database empty.