rename condidition variable and add mutex for pending update