Added method to guard a string