fix for error about calling gui functions outside of OnGUI