adding tableview as subview of Window to fix scrolling issue