Error in adapt function

Hi, I am trying to use adapt function for DirichletBC and form but I am getting an error:

TypeError: in method ‘adapt’, argument 1 of type ‘dolfin::ErrorControl const &’
Aborted (core dumped)

Please find the attached MWE for the error in boundary conditions:

from dolfin import *
mesh = UnitSquareMesh(10,10)
mu=1.0;
lmbda = 5.0;
W = VectorFunctionSpace(mesh, 'CG', 1)
u, v = TrialFunction(W), TestFunction(W)
top = CompiledSubDomain("near(x[1], 1.0) && on_boundary")
bot = CompiledSubDomain("near(x[1], 0.0) && on_boundary")
bcbot= DirichletBC(W, Constant((0.0,0.0)), bot)
bctop = DirichletBC(W.sub(1), Constant(0.01), top)
bc = [bcbot, bctop]
cell_markers = CellFunction("bool", mesh)
cell_markers.set_all(False)
for cell in cells(mesh):
    p = cell.midpoint()
    if cell.h()>1.0e-3:
        cell_markers[cell] = True

adapt(mesh, cell_markers)
mesh = mesh.child()
adapt(bc, mesh)