fixed bug when clicking sidebar buttons too quickly