Added logic for connection/database