fixed mysql insertion bug