implement file write on activity