Modified for better program switch in the UI