added check that buffer-file-name is nil