bug fix + enhancements