i think there is no prob with ur append mode but i think, when u are opening the file for writing but u are not using "out" mode. if this does not...
Separate names with a comma.