Added parameters to lock and changed lock_create