Need to fix SQL layer

Change-Id: I462d8fd50b223f865fc78ceb0911b6026086978c