Added another check encase a function is directly binded to a event