function needs to return str instead of echo