Fixed bug where fail event would crash app