fixed: add extension to filename if not supplied