adding error handling

warnings and networks errors added