fixed typo and overflow