remove lock and clean up