Add alert error back in
Move the error catching to the right place.