fixing some bugs and adding subviews