adding cursor for primarykey