bug fixes and stats tracking