working on offline mode