added checks for offline. Cleanup of directories

.