added exception catching for general failure