add sleep to see if timing is the problem