fixed error in comment and logic