Fixed error with undefined variable $headers