added try/except loops for android