New York - A pilot who died when his helicopter crashed atop a New York City skyscraper on June 10 had been flying erratically and said he did not know where he was shortly before the accident, the National Transportation Safety Board (NTSB) said in a preliminary report released on Tuesday.

The report said the pilot, who has been identified as Tim McCormack, 58, of Clinton Corners, New York, had asked air traffic controllers for permission to return to a heliport on East 34th Street and then changed course and altitude several times. He came within 500 feet of the heliport before reversing course and striking the 54-story AXA Equitable Center on Seventh Avenue in one of the city’s busiest areas a few blocks north of Times Square. No one in the building or on the ground was injured.

The NTSB said after taking off from the heliport McCormack had radioed that he did not know where he was.

New York Mayor Bill de Blasio said earlier this month to fly into tightly controlled airspace above midtown Manhattan the pilot would have needed approval from the air traffic control tower at LaGuardia Airport across the East River in the borough of Queens.

McCormack was a commercial pilot who had flown for American Continental Properties since 2014 the company said.

The weather on the day of the crash had been gray and rainy and the report said McCormack had waited in the heliport lounge for two hours continuously checking weather conditions on a tablet computer. Before he departed for the Linden, New Jersey, airport he told staff he saw “a 20-minute window to make it out,” the NTSB report said.