App now gets data but the javascript if not function