Better handling of object being passed in that is not a promise