minor typo fixing and some conditions