auto lock in background and minor ui fixes