Fixed bug with displaying correct tab - refactored sidepane controller