Adding update handler code