moved unpausing into a function.