some sql changes