improve assertion for better failure