Fix empty recordset error