change mode and filetype