added ability to set default file extension