fix view dir in get sidebar function
make echo optional in class functions