Added null check for single parameter queries