added variable assignment to createFile method