fixed constant as string problem
some code reformatting