Added exits in main