making it return string instead of log directly