Added check for file trimmed