fixed timer

fixed timer and bugs