Guard panic
Add test for panic