fixed bugs with writing to masterlist