fix bug in code.