app working according to connectivity