graphs some error handling added