bug in pages redirect