moving panic stuff into a separate file