Changed write file to User's choice