code cleanup
fixed keyguard disabling
fixed loss of state on rotation