Use 'with' statement for opening listfile.