register signal handler after initializing SDL.