Tried to fix hiding button panel bug (still have to test)