bad grammar executed when no session was present

index blew up when there was no session with the query_pred_array in it. Always good to test in dev with a new session. :)