Check if tempfile is created, terminate if otherwise