fixed bugs in docking