Finalisation of GUIFunc