fixed logic in base.html