fix a bug on timer