added lock on inactivity