fix handleFileClose with file correctly - only close custom viewer if the file argument matches the file in the viewer. Always close custom viewer if no file argument is present.