prints to file successfully