correct namespace check
remove unnecessary var
format object error string