fix update handler function