finally got it functioning on IOS and android