fix crashing gui