fixing sql insert issues