Fixed error with the before filter