Added check for pdf files.