added function to check if a file exists
added check if file exists, if not init file