added assert function