fix bug with panel hiding