update handler logic