fixed waiting bug and redistributed