use hasSuffix instead of contains for type of file