Makes it so program exits correctly