Added trim check for adding keywords