Modify adding function