Added check for file type of plain text