added some sql stuff