updated for SPA iPhone & android