adding of a file working now, index is written