only using timerflag function