MAJOR BUG FIX ON EXIT!!