fix a bug in adding work