chagned return string to be allocated