replace wait with communicate