fixed misnamed connection variable
fixed assertion against key that is never set