Add a function for success event, it is needed.