Now closing by event
Removed useless code + now 200ms sleep