changed parameter from keyword to q
modified sql to use paramaterized queries