Still has problems terminates, but fails to detect it