check if constants are defined first