fix bugs; add sidebar controller