Added Error Handler for a few cases. for all other cases the program will abort