The logic isn't sending to the correct pages. Please help