HARLEM, Manhattan (WABC) -- Eyewitness News has learned that Tuesday morning's 'A' train derailment was caused by an unsecured rail left in the rail bed between the two tracks after repair work had been done on Monday night. Why the rail was not secure is still not clear.As of Tuesday night, D Trains were only running local between Midtown and the Bronx. It is still not clear if the D will fully be restored for Wednesday morning's commute.Rail workers are working into the night, but the damage is extensive - shattered subway signals, busted switches and mangled rail cars ripped open like aluminum cans.Riders said it was terrifying."We just didn't know what was going on - what had happened," rider Michelle Ayoub said.Hundreds of riders made their way through the dark and smoky tunnel in a panic after breaking the windows and doors because no one told them what to do or what not to do. 17 people were later treated for minor injuries.It happened at 9:45 on Tuesday morning as the A train was headed southbound through Harlem. Sources say the train's motorman told investigators they passed the 135th Street Station without incident and that the tracks were clear of debris and the signals ahead were green. Moments later, the eight-car train came to a grinding halt when the emergency brake was activated.Only the fourth and fifth cars derailed, leading some experts to speculate that a cracked rail might have shattered under the weight of the train. MTA chairman Joseph Lhota seemed to dismiss that.What is clear is that many riders were left to fend for themselves with no instructions. Critics say that is unacceptable."They want to know what's wrong and they want to be able to rely in case of emergency," said Jaqi Cohen.Video posted on social media shows people walking through a train with no lights: