fixed abort function for portability