Added admin layout and fixed some bugs