fixing directory bugs, adding private page logic