fixed bug with unbindEvents being called without an events object