Fixed DB insert bug