added error handling of trying to run plt.tight_layout()