fixing timer double free issue