added more exception handling in collector