Implemented save operation in UI hook.