added method to check string expansion