added filetype check