check result before calling toString