added permalinks and fixed some bugs

added permalinks and fixed some bugs for the b2g ui