adding a function for panic