fixed bug in getIndent() function