fixing some sql stuff