handle ctrl-c in server