lock files behavior mod, cleanup from commented fuctions