fixed bug with switching to constant