this version can be reloaded while offline with minor issues
remove duplicate code