avoid using same variable twice in the same function
Merge pull request #659 from misho-kr/master

avoid using a variable twice in the same function