added navigation bar and fixed some bugs