added side check to avoid potential crash in GUIs