Added debug assert function