profile stuff again. sql query now works