fixed typo and code