Move setup signal handler ahead