added mask output to file