changed constructor parameter from component to object.