code clean up gui fixes