update the script to make it wptserve compatible