fixed some memory leaks, started putting in a boundary for the query string length