removed barrier by checking for status by wait