Updated assert function