fix: unused variables has been removed and global variable t changed to local variable.