function for single string