updated sql, it's a long shot