Added flat page support