prepare filetype checking function