fix bug in getting constant