improve the manage hook