fix for filetype subroutine