timer function works now