wait to finish the shift and reduce problem