sidebar function working