added pausing/resuming, added onStop() behavior, set window to secure