change in statistics

write to database variable res(int) instead of variable str(string)