Fix of an exception when the application was exited -> the PDF filestream was null. Added a saveClose method which checks if a Stream is null