adding script to check if phone gap is ready