Only convert object to string if it is an object