fixed bad free in main that was causing seg faults on quit