Exiting earlier when filetype doesn't match