added gui state node and fixed crash at application shutdown