add IsTimer function, fix timer bugs