fixed a bug ... in vain as the main problem is the timing.