remove trailing "\n" in return value