changed failwith to assertion