fixes sql stuff, again