modify panic function