Better exit handeling.