fixing my sql some more