moved handleOpenURL to head