Exit script properly