check file for errors upon each change