code clean up after bug fix