fix bugs in practice