fixed timer bug in angular directive