Update sample — add application callbacks