change check to assert