added ability to pass an object instead of uri for options