Trying to fix early termination