fixes page redirect bug