added the functionality for updating