callback function and ui improvement