dispatch semphores solved my problems