bug fixes, added stats