changed so that it is working offline