A Delta Air Lines flight managed to make it from New York to San Juan, Puerto Rico, and back Wednesday by navigating through Hurricane Irma

The flight took off from JFK International Airport at 8:12am, heading toward the rapidly approaching Category 5 storm, reports USA Today. After making a smooth landing in San Juan at 12:01pm despite strengthening winds and decreasing visibility, it was able to take off again after a mere 40 minutes on the ground with 173 passengers and crew. 

As the last commercial flight out of San Juan before the airport closed, it had to make its way to safety between the outer bands of the hurricane, Wired reports.