Use events instead of wait