fixed undifined constant bug when not in test env