fix bug with undefined constants