added error handling to plots