Change addFileToDevice to include new variable