fixed gui code so it can run at least