update the code with auto hidden tool bar