check syntax on opening a file