fix bug making mysql statement not take first row