International Airlines Group, the owner of Iberia and British Airways, said Wednesday it has reached an agreement with aerospace giant Boeing to buy 18 of its currently grounded 787 Dreamliners. The move is a show of confidence in the plane, which was grounded around the world in January due to problems with its battery system. \"IAG plans to convert 18 existing Boeing 787s options into firm orders for British Airways. They will be used to replace some of the airline\'s Boeing 747-400 aircraft between 2017 and 2021,\" the company said in a regulatory filing with the Spanish stock exchange. The order for the 18 Dreamliners is on top of an existing request by British Airways for 24 Dreamliners, the company added. The announcement comes after Boeing last week said that a test flight of a revamped battery system for its 787 went according to plan, the latest step in returning the plane to service. The entire fleet of 787s was grounded globally in January after a short circuit started a fire on a parked 787 at Boston\'s Logan Airport and smoke from a battery forced an emergency landing of another in Japan. IAG said it is also in talks with Boeing on the commercial conditions and delivery slots for a possible order of 747s for Spanish flag carrier Iberia. \"Firm orders will only be made when Iberia has restructured and reduced its cost base and is in a position to grow profitably,\" it said in the regulatory filing. IAG, the holding company set up for Iberia and British Airways after the two companies merged in 2011, posted an annual net loss of 943 million euros ($1.2 billion) in 2012 on severe financial strains at Iberia and a soaring fuel bill.