Removed unused code
Added automatic lock after page left or 3 minutes without activity