fixed WHERE and FOOTER