Add validity check for client index on database callback.