added stdout redirect to a text file