couple of bug fix