added filetype handling for json