fix #4 check that file exists first.