Added edit page and fixed session bugs