Fixed same variable 't' being used for two different purposes.