adding close for when opening a file fails and an exception is executed, then the desctructor is executed and the file it is closed no leak of resources RAII