fixed the timing issue