added additional pauseflag check -mitch