Exit process to free memory