wei's code for release