bug fix; debug added