added IOS main support