added automatic sidebar hiding