Added logic to provision database