notify out of if block