reworked how notify/wait work