making filetype checking more robust