Added more exception catching to prevent client from crashing.