adjusted assert function