database bug multi row insert bug fix