add a check for file existence to example