Added cursor for db