Make sure to lock before suspending