bug fix in code