changed pause and resume to lock and nlock respectively