added logic to save physical file to fs