add save method to retrieve current state of component