need to fix sql