Add check if file exists
Add logging