check replace both 'text' and 'application' in file types

fixes #538