do not allow more than maxRecords to be added to db

Change-Id: Ic501b20a395b6080180f7bd8f926ed8967bcb2e5