write the manage script