Added trim for trailing spaces on commands that breaks the hash