Add filetype safeguard