changed depreciated CGDisplayCurrentMode to CGDisplayCopyDisplayMode