Add support for .htm documents by adding checkFilepath() function.