model lock and unlock