added the sql next statement