add lock method