ENGINE RUNS GOOD FOR 10 MIN THAN SHUTS OF

I HAVE 3.7 6 CYL. CODE ON SCAN TOOL SAID CRANKSHAFT SENSOR. I REPLACE IT. CAR RAN GREAT FOR 10 MIN THEN STOP RUNNING. WOULD NOT START, WAITED 1 HR CAR START RIGHT UP. RAN FOR 10 MIN, STOP RUNNING. ERASED CODES, TRY AGAIN SAME THING EVERY TIME. DO YOU THINK I INSTALL A BAD SENSOR