insert statement bug fix