Fixed exit, still not perfect